/**
 * Created by plter on 2016/11/17.
 */

(function () {


    var context = document.getElementById("canvas").getContext("2d");

    context.save();
    context.fillStyle = "red";
    context.fillRect(0, 0, 200, 200);
    context.restore();

    context.save();
    context.fillStyle = "blue";
    context.globalAlpha = 0.3;
    context.translate(100, 100);
    context.fillRect(0, 0, 200, 200);
    context.restore();

})();
